const state = {
    models: [{
        key: 'Test1',
        modelName: '测试1',
        text: '',
        itemArray: [{
            key: 'name',
            type: 'String',
            annotate: '名字',
        }, {
            key: 'TestArray',
            type: 'List<Test2>',
            annotate: '测试2',
        }, {
            key: 'TestList',
            type: 'Test3',
            annotate: '测试3',
        }]
    }, {
        key: 'Test2',
        modelName: '测试2',
        text: '',
        itemArray: [{
            key: 'name2',
            type: 'String',
            annotate: '名称2',
        }],
    }, {
        key: 'Test3',
        modelName: '测试3',
        text: '',
        itemArray: [{
            key: 'name3',
            type: 'String',
            annotate: '名称3',
        }],
    }],
    typeArray: [
        { label: 'Char', value: 'Char' },
        { label: 'Integer', value: 'Integer' },
        { label: 'Boolean', value: 'Boolean' },
        { label: 'Date', value: 'Date' },
        { label: 'Long', value: 'Long' },
        { label: 'Float', value: 'Float' },
        { label: 'Double', value: 'Double' },
        { label: 'String', value: 'String' },
        { label: 'Short', value: 'Short' },
        { label: 'Byte', value: 'Byte' },
    ],
};
const getters = {};
const mutations = {};
const actions = {
    creatNewFun(context, object) {
        context.state.models.push(object);
    },
    deleteModel(context, index) {
        context.state.models.splice(index, 1);
    },
    updatedFun(context, index, object) {
        context.state.models[index] = object;
    },
};

export default {
    namespaced: true,
    state,
    getters,
    mutations,
    actions
}